<div class="goods_box">
  <el-breadcrumb separator-class="el-icon-arrow-right">
  <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
  <el-breadcrumb-item>商品管理</el-breadcrumb-item>
  <el-breadcrumb-item>商品列表</el-breadcrumb-item>
</el-breadcrumb>
<el-row style="margin: 15px 0;">
  <el-col :span="8">
    <el-input placeholder="请输入内容" v-model="searchText" class="input-with-select">
      <el-button slot="append" icon="el-icon-search"></el-button>
    </el-input>
  </el-col>
  <el-col :span="2" :offset="2">
    <el-button type="success" @click="addGoodsDialog = true">添加商品</el-button>
  </el-col>
</el-row>
<template>
  <el-table
    :data="goodsList"
    border
    style="width: 100%">
    <el-table-column
    type="index"
    label="#"
    width="60">
  </el-table-column>
    <el-table-column
      prop="goods_name"
      label="商品名称"
      width="350">
    </el-table-column>
    <el-table-column
      prop="goods_price"
      label="商品价格"
      width="100">
    </el-table-column>
    <el-table-column
      prop="goods_state"
      label="商品状态"
      width="100">
    </el-table-column>
    <el-table-column
      prop="goods_weight"
      label="商品重量"
      width="100">
    </el-table-column>
    <el-table-column
      prop="goods_number"
      label="商品数量"
      width="100">
    </el-table-column>
    <el-table-column
      prop="操作"
      label="操作">
      <el-button type="success">
        <i class="el-icon-edit"></i>
      </el-button>
      <el-button type="danger">
        <i class="el-icon-delete"></i>
      </el-button>
    </el-table-column>
  </el-table>
</template>
<el-row>
  <el-pagination
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="1"
    :page-sizes="[10, 20, 30, 40]"
    :page-size="100"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total">
  </el-pagination>
</el-row>
<!--添加商品 -->
<el-dialog title="添加商品" :visible.sync="addGoodsDialog">
  <el-form :model="addGoodsInfo" :rules="addGoodsRules" ref="addGoods">
    <el-form-item label="商品名称" prop="goods_name" label-width="800">
      <el-input v-model="addGoodsInfo.goods_name" autocomplete="off"></el-input>
    </el-form-item>
    <el-form-item label="商品价格" prop="goods_price" label-width="800">
      <el-input v-model="addGoodsInfo.goods_price" autocomplete="off"></el-input>
    </el-form-item>
    <el-form-item label="商品重量" prop="goods_weight" label-width="800">
      <el-input v-model="addGoodsInfo.goods_weight" autocomplete="off"></el-input>
    </el-form-item>
    <el-form-item label="商品数量" prop="goods_number" label-width="800">
      <el-input v-model="addGoodsInfo.goods_number" autocomplete="off"></el-input>
    </el-form-item>
    <el-form-item label="商品分类" prop="goods_cat" label-width="800">
      <el-cascader
      placeholder="试试搜索：指南"
      :options="addGoodsInfo.goods_cat"
      v-model="goods_cat"
      filterable></el-cascader>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="addGoodsDialog = false">取 消</el-button>
    <el-button type="primary" @click="addGoodsHandler">确 定</el-button>
  </div>
</el-dialog>
</div>